package Factory;

/**
 * Created with IntelliJ IDEA.
 * User: C13T
 * Date: 10.07.13
 * Time: 19:05
 * To change this template use File | Settings | File Templates.
 */
    import java.io.IOException;
    import java.util.Properties;

    /**
     * Created with IntelliJ IDEA.
     * User: Administrator
     * Date: 19.03.13
     * Time: 21:49
     * To change this template use File | Settings | File Templates.
     */
    public class PropertyLoader {

        private static final String PROP_FILE = "/application.properties";

        public static String loadProperty(String name) {
            Properties props = new Properties();
            try {
                props.load(PropertyLoader.class.getResourceAsStream(PROP_FILE));  //преобразов файл в инпут стрим
            } catch (IOException e) {
                e.printStackTrace();
            }

            String value = "";

            if (name != null) {
                value = props.getProperty(name);
            }
            return value;
        }
    }

